import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

import App from './App.vue'
import router from './router'
// 重新引入 SCSS 文件
import '@/styles/index.scss'

/**
 * 智慧医疗管理系统主应用入口
 * 配置Element Plus UI框架和全局设置
 */
const app = createApp(App)

// 注册Element Plus图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 使用Element Plus，配置中文语言包
app.use(ElementPlus, {
  locale: zhCn,
})

app.use(createPinia())
app.use(router)

app.mount('#app')
